package com.yourenbang.lingyun.transaction.web.service.impl.petal;

import com.yourenbang.lingyun.constants.enums.PlatNoEnums;
import com.yourenbang.lingyun.core.message.Result;
import com.yourenbang.lingyun.transaction.mapper.TransactionFundAccountWithdrawPaymentMapper;
import com.yourenbang.lingyun.transaction.web.domain.dto.PullDataDTO;
import com.yourenbang.lingyun.transaction.web.service.petal.PullDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Slf4j
@Service
public class PullDataServiceImpl implements PullDataService {
    @Autowired
    private TransactionFundAccountWithdrawPaymentMapper fundAccountWithdrawPaymentMapper;

    @Override
    public Result<List<Map<String, Object>>> pullPledgeRefundBill(PullDataDTO dto) {
        if(dto.getPlatNo()==null){
            dto.setPlatNo(PlatNoEnums.TYF.getCode());
        }
        List<Map<String, Object>> billList = fundAccountWithdrawPaymentMapper.listPledgeRefundBill(dto);
        return Result.builder().success(billList);
    }
}
